home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Tools / Mac / MacMake.rul < prev    next >
Encoding:
Text File  |  1996-09-17  |  9.7 KB  |  303 lines  |  [TEXT/MPS ]

  1. #####################################################################################
  2. # Dummy target just in case some variables are empty
  3. #####################################################################################
  4.  
  5. SafeTarget = "{FWToolsDir}MacMake.rul"
  6.  
  7. #####################################################################################
  8. # CFM Static Library
  9. # A static library target is the same as the IDE target (SOM and resources)
  10. # plus the code target (.o)
  11. #
  12. # The static target is <module>.LIB (abstract)
  13. #
  14. # All object files in __ComponentObjects are libbed into <module>.o in the
  15. # objects folder. It you want it in the Lib folder see the .bmk for the
  16. # OS:Layer.
  17. #
  18. # All som and resource files are built as described below for the .IDE target.
  19. #####################################################################################
  20.  
  21. "{_FWTargetObjectsDir}{__ComponentName}.LIB" ƒ ∂
  22.             "{_FWTargetObjectsDir}{__ComponentName}.IDE" ∂
  23.             "{_FWLibDir}{__ComponentName}.o" ∂
  24.             {__OtherComponentDependencies}
  25.  
  26. "{_FWLibDir}{__ComponentName}.o" ƒ ∂
  27.         {__ComponentObjects} {SafeTarget}
  28.     {_FWEcho} {_FWEchoOptions} "Libbing:          {__ComponentName}.o"
  29.     {_FWLib} ∂
  30.         {__StaticLibraryLinkOptions} ∂
  31.         {__ComponentObjects} ∂
  32.         -o {TargDir}{__ComponentName}.o
  33.  
  34. #####################################################################################
  35. # Resources build Target
  36. #
  37. # This is an abstract target for building just resources.
  38. #
  39. # The IDE target is <module>.RSED (abstract)
  40. #
  41. # All resource files in __ComponentResources are built and consolidated into
  42. # <module>.IDE.rsrc in the objects directory.
  43. #####################################################################################
  44. # Abstract Target dependencies
  45. "{_FWTargetObjectsDir}{__ComponentName}.RSED" ƒ ∂
  46.             {__ComponentResources} {SafeTarget}
  47.  
  48. "{_FWTargetObjectsDir}{__ComponentName}.IDE.rsrc" ƒ ∂
  49.             {__ComponentResources} {SafeTarget}
  50.     #{_FWEcho} {_FWEchoOptions} "Consolidating: {__ComponentName}"
  51.     #Begin
  52.     #    for __resourceFile__ in {__FrameworkResources}
  53.     #        echo "include ∂"{__resourceFile__}∂" not ∂'ckid∂';"
  54.     #    end
  55.     #    for __resourceFile__ in {__ComponentResources}
  56.     #        echo "include ∂"{__resourceFile__}∂" not ∂'ckid∂';"
  57.     #    end
  58.     #End | {_FWRC} -t rsrc -c RSED -o "{_FWTargetObjectsDir}{__ComponentName}.IDE.rsrc"    
  59.  
  60. #####################################################################################
  61. # SOM build target
  62. # This an abstract target to get somc to update all the SOM-related files. It's meant
  63. # to be used by Rainbow.
  64. #
  65. # All som-dependent files in __ComponentSourcesFromIDL are updated by the SOM
  66. # compiler.
  67. #####################################################################################
  68.  
  69. "{_FWTargetObjectsDir}{__ComponentName}.SOM" ƒ ∂
  70.             {__ComponentSourcesFromIDL} {SafeTarget}
  71.  
  72. #####################################################################################
  73. # IDE build Target
  74. #
  75. # This is an abstract target for building resources and SOM-related files for 
  76. # the MetroWerks and Symantec IDEs (which will soon enough build their own rsrc files).
  77. #
  78. # The IDE target is <module>.IDE (abstract)
  79. #
  80. # All it does is invoke the .RSED and .SOM targets.
  81. #####################################################################################
  82. # Abstract Target dependencies
  83. "{_FWTargetObjectsDir}{__ComponentName}.IDE" ƒ ∂
  84.             "{_FWTargetObjectsDir}{__ComponentName}.SOM" ∂
  85.             "{_FWTargetObjectsDir}{__ComponentName}.RSED"
  86.  
  87. #####################################################################################
  88. # Inference Rules
  89. #####################################################################################
  90.  
  91. .a.o    ƒ    .a 
  92.     {_FWEcho} {_FWEchoOptions} "Assembling:       {default}.a"
  93.     {_FWAsm} ∂
  94.         {_FWAsmOptions} ∂
  95.         {__IncludeDirs} ∂
  96.         -o {_FWObjDir}{default}.a.o ∂
  97.         {depDir}{default}.a
  98.  
  99. .c.o    ƒ    .c 
  100.     {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.c"
  101.     {_FWC} ∂
  102.         {_FWCOptions} ∂
  103.         {__COptions} ∂
  104.         {__IncludeDirs} ∂
  105.         -o {TargDir}{default}.c.o ∂
  106.         {depDir}{default}.c
  107.  
  108. .cp.o    ƒ    .cp
  109.     {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.cp"
  110.     {_FWCpp} ∂
  111.         {_FWCppOptions} ∂
  112.         {__CppOptions} ∂
  113.         {__CIncludeDirs} ∂
  114.         {__IncludeDirs} ∂
  115.         -o {TargDir}{default}.cp.o ∂
  116.         {depDir}{default}.cp
  117.  
  118. .cpp.o    ƒ    .cpp
  119.     {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.cpp"
  120. #    We use a precompiled header file only if {__PrecompiledHeaderFile} is defined.
  121.     If `Exists {__PrecompiledHeaderFile}`
  122.         {_FWCpp} ∂
  123.             {_FWCppOptions} ∂
  124.             {__CppOptions} ∂
  125.             {__IncludeDirs} ∂
  126.             {__CIncludeDirs} ∂
  127.             -load {__PrecompiledHeaderFile} ∂
  128.             -o {TargDir}{default}.cpp.o ∂
  129.             {depDir}{default}.cpp
  130.     Else
  131.         {_FWCpp} ∂
  132.             {_FWCppOptions} ∂
  133.             {__CppOptions} ∂
  134.             {__IncludeDirs} ∂
  135.             {__CIncludeDirs} ∂
  136.             -o {TargDir}{default}.cpp.o ∂
  137.             {depDir}{default}.cpp
  138.     End
  139.  
  140. .cpp ƒ .idl
  141.     {_FWEcho} {_FWEchoOptions} "Compiling:        {default}.idl --> {default}.cpp"
  142.     somc ∂
  143.         {__IDLIncludeDirs} ∂
  144.         -m cpluscpp -p -e xc ∂
  145.         -D __PRIVATE__ ∂
  146.         -I "{ODF}Found:FWCommon:" ∂
  147.         -I "{FWSOMIncludes}" ∂
  148.         -I "{FWODIDLIncludes}" ∂
  149.         -o {TargDir} ∂
  150.         {depDir}{Default}.idl
  151.     SetFile -m . {Targ}
  152.  
  153. .xih ƒ .idl
  154.     {_FWEcho} {_FWEchoOptions} "Compiling:        {Default}.idl --> {Default}.xih"
  155.     somc ∂
  156.         {__IDLIncludeDirs} ∂
  157.         -m cpluscpp -p -e xih ∂
  158.         -D __PRIVATE__ ∂
  159.         -I "{ODF}Found:FWCommon:" ∂
  160.         -I "{FWSOMIncludes}" ∂
  161.         -I "{FWODIDLIncludes}" ∂
  162.         -o {TargDir} ∂
  163.         -m chkexcept ∂
  164.         {DepDir}{Default}.idl
  165.  
  166. .xh ƒ .idl
  167.     {_FWEcho} {_FWEchoOptions} "Compiling:        {Default}.idl --> {Default}.xh"
  168.     somc ∂
  169.         {__IDLIncludeDirs} ∂
  170.         -m cpluscpp -e xh ∂
  171.         -D __PRIVATE__ ∂
  172.         -I "{ODF}Found:FWCommon:" ∂
  173.         -I "{FWSOMIncludes}" ∂
  174.         -I "{FWODIDLIncludes}" ∂
  175.         -o {TargDir} ∂
  176.         -m chkexcept ∂
  177.         {DepDir}{Default}.idl
  178.  
  179. .rsrc    ƒ    .fr
  180.     {_FWEcho} {_FWEchoOptions} "ODFrc:            {default}.fr --> {Default}.rsrc"
  181.     {_FWODFRC} ∂
  182.         {_FWODFRCOptions} ∂
  183.         {__FWRCIncludeDirs} ∂
  184.         -o {TargDir}{default}.rsrc ∂
  185.         {DepDir}{default}.fr
  186.  
  187. .rsrc    ƒ    .r
  188.     {_FWEcho} {_FWEchoOptions} "Rezzing:          {default}.r --> {Default}.rsrc"
  189.     {_FWRC} ∂
  190.         {_FWRCOptions} ∂
  191.         {__FWRCIncludeDirs} ∂
  192.         -o {TargDir}{default}.rsrc ∂
  193.         {DepDir}{default}.r
  194.  
  195. #####################################################################################
  196. # Maintenance Targets
  197. #####################################################################################
  198.  
  199. "{_FWTargetObjectsDir}"CleanObj    ƒ
  200.     {_FWEcho} {_FWEchoOptions} "Deleting Object Files from:     {_FWTargetObjectsDir}"
  201.     delete -y -i {__ComponentObjects}
  202.  
  203. "{_FWTargetObjectsDir}"CleanRes    ƒ
  204.     {_FWEcho} {_FWEchoOptions} "Deleting Resources from :     {_FWTargetObjectsDir}"
  205.     delete -y -i {__ComponentResources}
  206.         
  207. "{_FWTargetObjectsDir}"CleanLib    ƒ
  208.     {_FWEcho} {_FWEchoOptions} "Deleting Libraries from :     {_FWLibDir}"
  209.     delete -y -i "{_FWLibDir}{__ComponentName}.o"
  210.     delete -y -i "{_FWLibDir}{__ComponentName}.rsrc"
  211.  
  212. "{_FWTargetObjectsDir}"CleanAll    ƒ ∂
  213.     "{_FWTargetObjectsDir}"CleanObjects ∂
  214.     "{_FWTargetObjectsDir}"CleanResources ∂
  215.     "{_FWTargetObjectsDir}"CleanLibs
  216.  
  217. "{_FWTargetObjectsDir}"KillDir    ƒ ∂
  218.     "{_FWTargetObjectsDir}"CleanLibs
  219.     {_FWEcho} {_FWEchoOptions} "Deleting Build Directory:     {_FWTargetObjectsDir}"
  220.     delete -y -i "{_FWTargetObjectsDir}"
  221.     
  222. #####################################################################################
  223. # CFM Shared Libraries
  224. #
  225. # A shared library target is the same as the IDE target (som/idl and resources)
  226. # plus it will use the MPW-hosted compiler specified by the build suite to compile
  227. # the object files. This case will mainly be CFM-68K
  228. #
  229. # The shared library target is <module>.CFM (abstract)
  230. #
  231. # All __ComponentObjects are linked into a shared library in the objects folder.
  232. #
  233. # All som/idl and resource files are built as described in MacMake.rul for the IDE
  234. # target.
  235. #####################################################################################
  236. # Abstract Target dependencies
  237. "{_FWTargetObjectsDir}{__ComponentName}.CFM" ƒ ∂
  238.             "{_FWTargetObjectsDir}{__ComponentName}.IDE" ∂
  239.             "{_FWBinDir}{__ComponentName}" ∂
  240.             {__OtherComponentDependencies}
  241.  
  242. "{_FWBinDir}{__ComponentName}" ƒ ∂
  243.             "{_FWObjDir}{__ComponentName}.pef"
  244.     duplicate -y "{_FWObjDir}{__ComponentName}.pef" {Targ}
  245.     If  `Exists "{_FWObjDir}{__ComponentName}.SYM"`
  246.         duplicate -y "{_FWObjDir}{__ComponentName}.SYM" {Targ}.SYM
  247.     End
  248.     
  249. "{_FWObjDir}{__ComponentName}Cache.rsrc" ƒ ∂
  250.             {__FrameworkResources} ∂
  251.             {__ComponentResources}
  252.     {_FWEcho} {_FWEchoOptions} "Consolidating: {__ComponentName}"
  253.     Begin
  254.         for __resourceFile__ in {__FrameworkResources}
  255.             echo  "include ∂"{__resourceFile__}∂";"
  256.         end
  257.         for __resourceFile__ in {__ComponentResources}
  258.             echo  "include ∂"{__resourceFile__}∂";"
  259.         end
  260.     End | {_FWRC} -a -o "{_FWObjDir}{__ComponentName}Cache.rsrc"
  261.  
  262. "{_FWObjDir}{__ComponentName}.seg" ƒ ∂
  263.             {__ComponentObjects} ∂
  264.             {__OpenDocObjects} ∂
  265.             {__ODFObjects} ∂
  266.             {__OtherObjects}
  267.         {_FWEcho} {_FWEchoOptions} "Linking:     {_FWObjDir}{__ComponentName}"
  268.         {_FWLink} ∂
  269.             {_FWLinkOptions} ∂
  270.             {__SharedLibraryLinkOptions} ∂
  271.             -weaklib QuickDrawGXLib,AppleScriptLib{__WeakLinkLibs} ∂
  272.             -init {__CFMInitFunction} ∂
  273.             {__Exports} ∂
  274.             {__InitLibs} ∂
  275.             {__ComponentObjects} ∂
  276.             {__ODFObjects} ∂
  277.             {__OpenDocObjects} ∂
  278.             {__OtherObjects} ∂
  279.             {__SystemObjects} ∂
  280.             -o {Targ}
  281. #    If !{Status}
  282. #        ILinkToSym -mf {Targ}.NJ -o "{_FWObjDir}{__ComponentName}".SYM 
  283. #    End
  284.  
  285. "{_FWObjDir}{__ComponentName}.pef" ƒ ∂
  286.             "{_FWObjDir}{__ComponentName}.seg" ∂
  287.             "{_FWObjDir}{__ComponentName}Cache.rsrc"
  288.     If "{_FWLink}" == 'ILink'
  289.         MakeFlat "{_FWObjDir}{__ComponentName}".seg -o {Targ}
  290.     Else
  291.         Duplicate -y "{_FWObjDir}{__ComponentName}".seg {Targ}
  292.     End
  293.     {_FWEcho} {_FWEchoOptions} Copying Resources From: "{_FWObjDir}{__ComponentName}Cache.rsrc"
  294.     Echo "include ∂"{_FWObjDir}{__ComponentName}Cache.rsrc∂";" | Rez -a -o {Targ}
  295.     If {__ComponentSignature}
  296.         SetFile -c {__ComponentSignature} -a B -t 'shlb' -m . {Targ}
  297.     Else
  298.         {_FWEcho} {_FWEchoOptions} "Warning: __ComponentSignature not set; using default (cfmg)."
  299.         SetFile -c 'cfmg' -t 'shlb' -m . {Targ}
  300.     End
  301.